package demo1;

public class MyArray<T> {
    public Object[] array = new Object[10];

    public void setArray(int pos, T obj) {
        array[pos] = obj;
    }

    public T getArray(int pos) {
        return (T) array[pos];
    }

    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<>();
        myArray.setArray(1,3);
        Integer a = myArray.getArray(1);
    }
}
